package com.briup.app01.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.briup.app01.bean.SysUser;
import com.briup.app01.bean.SysUserExample;
import com.briup.app01.bean.SysUserExample.Criteria;
import com.briup.app01.dao.SysUserMapper;
import com.briup.app01.service.SysUserService;
@Service
public class SysUserServiceImpl implements SysUserService {
	@Autowired
	private SysUserMapper userMapper;
	public void saveOrUpdate(SysUser user) {
		if(user.getUsrId()==null) {
			userMapper.insertSelective(user);
		}else {
			userMapper.updateByPrimaryKey(user);
	     }
	}
	public void deleteById(long id) {
		userMapper.deleteByPrimaryKey(id);
	}
	public SysUser selectById(long id) {
		return userMapper.selectByPrimaryKey(id);
	}
	
	public List<SysUser> select(long name, String dexc,String flag) {
		SysUserExample example = new SysUserExample();
/*    	Criteria criteria = example.createCriteria();
    	if(type!=null) {
    		criteria.andSvrTypeLike("%"+type+"%");
    	}
    	if(title!=null) {
    		criteria.andSvrTitleLike("%"+title+"%");
    }
    	if(status!=null) {
    		criteria.andSvrStatusLike("%"+status+"%");
    	}*/
    		return userMapper.selectByExample(example);
	}
	
	
	public List<SysUser> select(String name, long password, String role_name) {
		// TODO Auto-generated method stub
		return null;
	}
	
	}
	